home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 034a / twview82.zip / EDITBASE.INC < prev    next >
Text File  |  1991-02-04  |  3KB  |  106 lines

  1. procedure MakePort( var update : boolean );
  2. var
  3.   s : SectorIndex;
  4.   pt : integer;
  5. begin
  6.   write('Make a port out of which ');
  7.   s := GetSector;
  8.   if s <> 0 then
  9.     if space.sectors[ s ].portType <> NotAPort then
  10.       writeln( s, ' is already a port!')
  11.     else
  12.       begin
  13.         repeat
  14.           writeln('Describe this port:');
  15.           writeln(' 0 : Buy all products');
  16.           writeln(' 1 : Sell Fuel Ore; buy Organics and Equipment');
  17.           writeln(' 2 : Sell Organics; buy Fuel Ore and Equipment');
  18.           writeln(' 3 : Sell Fuel Ore and Organics; buy Equipment');
  19.           writeln(' 4 : Sell Equipment; buy Fuel Ore and Organics');
  20.           writeln(' 5 : Sell Equipment and Fuel Ore; buy Organics');
  21.           writeln(' 6 : Sell Equipment and Organics; buy Fuel Ore');
  22.           writeln(' 7 : Sell all products');
  23.           writeln(' 8 : Sell fighter, shields, holds (Class 0)');
  24.           writeln;
  25.           write('Port description? ');
  26.           readln( pt );
  27.         until (0<=pt) and (pt <= 8);
  28.         space.sectors[s].portType := pt;
  29.         update := true;
  30.       end; {if else}
  31. end;
  32.  
  33. procedure KillPort( var update : boolean );
  34. var
  35.   s : SectorIndex;
  36. begin
  37.   write('Remove Record for Port in which ');
  38.   s := GetSector;
  39.   if s <> 0 then
  40.     if space.sectors[s].PortType = NotAPort then
  41.       writeln( 'I have no record of ', s, ' being a port.')
  42.     else
  43.       begin
  44.         space.sectors[s].portType := NotAPort;
  45.         update := true;
  46.       end;
  47. end;
  48.  
  49. procedure SetDock( var update : boolean );
  50. var
  51.   sd : SectorIndex;
  52. begin
  53.   if space.dock = 0 then
  54.     writeln('Space Dock location is not known')
  55.   else
  56.     writeln('Current space dock in sector ', space.dock );
  57.   write('Put Space Dock in which ');
  58.   sd := GetSector;
  59.   update := update or (sd <> space.dock);
  60.   space.dock := sd;
  61. end;
  62.  
  63. procedure Unexplore( var update : boolean );
  64. var
  65.   us : sectorIndex;
  66. begin
  67.   write('Mark as Unexplored Which ');
  68.   us := GetSector;
  69.   if us <> 0 then
  70.     if space.sectors[ us ].number = Unexplored then
  71.       writeln( 'Sector ', us, ' is already marked as unexplored.')
  72.     else
  73.       begin
  74.         writeln('Marking ', us, ' as unexplored.');
  75.         space.sectors[ us ].number := Unexplored;
  76.         update := true;
  77.       end; {if else}
  78. end; {unexplore}
  79.  
  80. procedure EditMenu( var update : boolean );
  81. { choices for direct editing the data base }
  82. var
  83.   ch : char;
  84. begin
  85.   repeat
  86.     repeat
  87.       writeln('Declare a sector to be a <P>ort');
  88.       writeln('Declare a sector <N>OT to be a port');
  89.       writeln('Define location of Star <D>ock');
  90.       writeln('Make sector <U>nexplored');
  91.       writeln;
  92.       writeln('<Q>uit');
  93.       writeln;
  94.       write('Your choice? ');
  95.       readln( ch );
  96.       ch := upcase( ch );
  97.     until ch in ['P', 'N', 'D', 'U', 'Q'];
  98.     case ch of
  99.       'P' : Makeport( update );
  100.       'N' : Killport( update );
  101.       'D' : setDock( update );
  102.       'U' : unexplore( update );
  103.       'Q' : ;
  104.     end; {case}
  105.   until ch = 'Q';
  106. end; {Edit Menu}